#pragma once
#include "Globals.hpp"
#include "Entity.h"
#include "ExecutionLog.h"
#include <map>
#include <vector>


/*

	The sound engine wraps the SDLmixer library.  It stores sound data and handles playing of sounds.  It also wraps the sound data to an ID system.

	Type: Singleton

*/

#define SoundPlay SoundEngine::Instance()

class SoundEngine
{
public:

	void Play(string name);
	void Pause();
	void Resume();
	void StopPlaying();

	void Update(); // iterates through all of the music files
	static SoundEngine* Instance();
	static void CleanUp();
	void Init();
	void LoadSound(string name, string filename);


private:

	SoundEngine();
	SoundEngine(const SoundEngine&);
	SoundEngine& operator =(const SoundEngine&);
	~SoundEngine();

	static vector<Mix_Music*> m_sounds;
	static unsigned int m_currentlyPlaying;
	static map<string, int> NameToIDMap; // Used for finding the ID of a given Entity through it's name
										// NOTE: Needs to be initialized. 
};